<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
		<meta charset="utf-8" />
	<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
   	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="#">数据统计</a></li>
    <li><a href="#">问题回复统计</a></li>
    </ul>
    </div>
    <div class="rightinfo">
    <div class="tools">
         <form id="searchForm" class="form-search"
						action="question/question_statistics_page_list.do" method="post">
    		<ul class="seachform1">
    		<c:if test="${userRole <=2 }">
    		<li>选择院系：</li>  
    	    <li>
    	    <select name="DeptCode" class="chosen-select col-xs-10 col-sm-5" >
						<option value="" > -- 全部 -- </option>
						<c:forEach items="${departmentInfoList}" var="departmentInfo">
							<option value="${departmentInfo.XYDM }" <c:if test="${departmentInfo.XYDM == DeptCode }">selected</c:if> >${departmentInfo.XYMC }</option>
						</c:forEach>
					</select>
    	</li>
    	</c:if>
    	<c:if test="${userRole >2 }">
    	<li><input value="${departmentName }" name="DeptCode" type="hidden">${departmentName }
    	</li>
    	</c:if>
		<li>选择入学年份：</li>  
    	<li>
    		<select name="grade" id="grade" >
     		<option value="0" > -- 全部 -- </option>
						<c:forEach items="${gradeList}" var="grade">
							<option value="${grade }" >${grade}</option>
						</c:forEach>
       </select>
    	</li>
			<li><input name="" type="button" id="btnSearch" class="scbtn" value="查询"/></li>  
			<div class="clearfix"></div>
		</ul>	
		</form>
    </div>
     <div class="statistical" id="statistical">
    </div>
    </div>
    <script type="text/javascript" src="js/jquery-1.7.2.js"></script>
<script src="js/echarts.min.js"></script>
     <script type="text/javascript">
	$('.tablelist tbody tr:odd').addClass('odd');
	$( "#btnSearch" ).on('click', function(e) {
		$("#searchForm").submit();
	});

	<%--柱状图--%>
	var myChart = echarts.init(document.getElementById('statistical'));
	var option = {
	title : {
	<%--text: '邀请人数和实时在线人数',--%>
	},
	tooltip : {
	trigger: 'axis'
	},
	legend: {
	data:['总问题数','未回复条数']
	},
	grid: {
	left: '20%',
	right: '30%',
	bottom: '0%',
	top:'25%',
	containLabel: true
	},
	toolbox: {
	show : true,
	},
	calculable : true,
	xAxis : [
	{
	type : 'category',
	data : ['']
	}
	],
	yAxis : [
	{
	type : 'value',
	data : ['20','40']
	}
	],
	series : [
	{
	name:'总问题数',
	type:'bar',
	data:['${questionCount}'],
	markPoint : {
	data : [
	{type : 'max', name: '最大值'},
	]
	},
	markLine : {
	data : [
	{type : 'average', name: '平均值'}
	]
	}
	},
	{
	name:'未回复条数',
	type:'bar',
	data:['${questionNotesCount}'],
	markPoint : {
	data : [
	{name : '最多', value : 150, xAxis: 0.5},
	]
	},
	markLine : {
	data : [
	{type : 'average', name : '平均值'}
	]
	}
	},
	]
	};
	myChart.setOption(option);
	</script>

	</script>
</body>

</html>
